<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>模板管理</title>
<%
	String sid = request.getParameter("secondMenuId");
	request.getSession().setAttribute("secondMenuId", sid);
%>
<%@include file="/jsp/include/common.jsp"%>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/assets/ui/jquery-easyui-1.4.1/extend/tree.loadFilter.js"></script>

</head>
<body class="easyui-layout">
	<%@include file="/jsp/include/commonLayout.jsp"%>
	<div data-options="region:'center'">
		<div class="easyui-panel" title="模板管理" data-options="fit:true"	style="padding: 5px">
			<div class="easyui-layout" data-options="fit:true">
				<div data-options="region:'west'" style="width: 180px">
					<ul id="partTree" class="easyui-tree"></ul>
				</div>
				<div data-options="region:'center'">
					<div id="dlg-buttons">
						<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'"
							onclick="saveOrEditUser()">保存</a> <a class="easyui-linkbutton"
							data-options="iconCls:'icon-cancel'"
							onclick="javascript:$('#saveOrEditDlg').dialog('close')">取消</a>
					</div>
					<table>
						<tr>
							<td width="20%" style="text-align: right;">品牌</td>
							<td width="30%"><select id="brand" name="brand"
								class="easyui-combobox" style="width: 135px;">
									<option>奥迪</option>
									<option>宝马</option>
									<option>马自达</option>
							</select></td>
							<td width="20%" style="text-align: right;">车型</td>
							<td width="30%"><input id="carid" name="carid"
								value="A4 1.6L"></td>
						</tr>
						<tr>
							<td style="text-align: right;">整车编号</td>
							<td><input id="email" name="email" class="easyui-textbox"
								value="MT"></td>
							<td style="text-align: right;">零件号</td>
							<td><input id="email" name="email" class="easyui-textbox"></td>

						</tr>
						<tr>
							<td style="text-align: right;">类型</td>
							<td><input id="email" name="email" class="easyui-textbox"></td>
							<td></td>
							<td></td>

						</tr>
						<tr>
							<td><b>零件类型信息描述</b></td>
							<td></td>
							<td></td>
							<td></td>
						</tr>
						<tr>
							<td width="20%" style="text-align: right;">基本类型</td>
							<td width="30%"><select id="basicType"
								class="easyui-combobox" name="basicType" style="width: 200px;">
									<option>整车</option>
									<option>总成</option>
									<option>子组</option>
									<option>零件</option>
							</select></td>
							<td width="20%" style="text-align: right;">技术类型</td>
							<td width="30%"><select id="technologyTypeManager"
								class="easyui-combobox" name="technologyTypeManager"
								style="width: 200px;">
									<option>空调</option>
									<option>显示器</option>
							</select></td>
						</tr>
					</table>
					<!-- 数据表格  -->
					<div id="basicTab" class="easyui-tabs" data-options="fit:true">
						<div title="基本类型">
							<table id="basicTable" style="margin-top: 10px">
								<tr>
									<td style="width:150px;text-align: right;">零件名称</td>
									<td><input class="easyui-textbox" /></td>
									<td style="width:150px;text-align: right;">所属整车</td>
									<td><input class="easyui-textbox" /></td>
									<td style="width:150px;text-align: right;">供应商</td>
									<td><input class="easyui-textbox" /></td>
								</tr>
								<tr>
									<td style="width:150px;text-align: right;">成本（元）</td>
									<td><input class="easyui-textbox" /></td>
									<td style="width:150px;text-align: right;">重量（g）</td>
									<td><input class="easyui-textbox" /></td>
									<td style="width:150px;text-align: right;">工艺</td>
									<td><input class="easyui-textbox" /></td>
								</tr>
								<tr>
									<td style="width:150px;text-align: right;">尺寸（mm）</td>
									<td><input class="easyui-textbox" /></td>
									<td style="width:150px;text-align: right;">创建时间</td>
									<td><input class="easyui-textbox" /></td>
									<td style="width:150px;text-align: right;">责任人</td>
									<td><input class="easyui-textbox" /></td>
								</tr>
								<tr>
									<td style="width:150px;text-align: right;">状态</td>
									<td><input class="easyui-textbox" /></td>
									<td></td>
									<td></td>
									<td></td>
									<td></td>
								</tr>
							</table>
						</div>
						<div title="技术类型">
							<table id="techTable" style="margin-top: 10px">
								<tr>
									<td style="width:150px;text-align: right;">转角弧度</td>
									<td><input class="easyui-textbox" /></td>
									<td style="width:150px;text-align: right;">减震承重</td>
									<td><input class="easyui-textbox" /></td>
									<td style="width:150px;text-align: right;">二次成型工艺</td>
									<td><input class="easyui-textbox" /></td>
								</tr>
								<tr>
									<td style="width:150px;text-align: right;">空调最低温度</td>
									<td><input class="easyui-textbox" /></td>
									<td style="width:150px;text-align: right;">一次成型工艺</td>
									<td><input class="easyui-textbox" /></td>
									<td></td>
									<td></td>
								</tr>
							</table>
						</div>
					</div>
					<div id="partTab" class="easyui-tabs"
						style="width: 100%; height: 700px;">
						<div title="零件信息">
							<table id="mouldPartBasicDataGrid"></table>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
	//初始化树
	$('#partTree').tree(
			{
				url : 'treeDemo.json',
				parentField : "pid",
				textFiled : "name",
				idFiled : "id",
				onClick : function(node) {
					if (node.id > 1) {
						$("#mouldTab").hide();
						$("#partTab").show();
						initMouldDataGrid(mouldPartBasicDataGrid,
								'treeDemo.json', node.level + '级零件信息管理');
					} else {
						$("#partTab").hide();
						$("#mouldTab").show();
					}
				},
				onContextMenu : function(e, node) {
					e.preventDefault();
					// 查找节点
					$('#partTree').tree('select', node.target);
					// 显示快捷菜单
					$('#partTreeMenu').menu('show', {
						left : e.pageX,
						top : e.pageY
					});
					selectNode = node;
				}
			});

	//异步加载右侧详细信息
	function getDetil() {
		$('#rightPanel').panel({
			href : 'content_url.php',
			onLoad : function() {
				alert('loaded successfully');
			}
		});
	};

	function partTreeAdd() {
		$('#saveOrEditTreeDlg').dialog('open').dialog('setTitle', '添加');
		$('#saveOrEditTreeForm').form('load', {
			pid : selectNode.name,
			name : '',
			level : selectNode.level + 1
		});

	};

	function partTreeEdit() {
		$('#saveOrEditTreeDlg').dialog('open').dialog('setTitle', '编辑');
		$('#pidColumn').hide();
		$('#saveOrEditTreeForm').form('load', selectNode);

	};

	$('#carid').combo({
		required : true,
		multiple : true
	});
</script>
</html>
